﻿@model IList<Eoffice.Models.CVDEN>

@{
    ViewBag.Title = "DANH SÁCH CÔNG VĂN ĐẾN";
    Layout = "~/Views/Shared/_LayoutPage.cshtml";
    <script src="~/Scripts/jquery-latest.js"></script>
    <script src="~/Scripts/jquery.shorten.1.0.js"></script>
}

<h1>@ViewBag.Title</h1>
@*@{Html.RenderAction("_search", "CvDen");}*@

@*<div class="TopSearchImpExp">
        <br />Tìm theo &nbsp;
        <input type="radio" checked="checked" name="rdoLoai" /><span class="txtrdoLoai tn">&nbsp;số công văn đến</span>
        <input type="radio" name="rdoLoai" /><span class="txtrdoLoai">&nbsp;trích yếu công văn đến</span>
        @if(true)
        {
            <div class="searchTop">
                @{Html.RenderAction("timkiem_socvden", "Search");}
            </div>
            <div class="h10"></div>
        }
    </div>


    @Html.Partial("tab")
        <div class="h10"></div>
        <div class="h10"></div>*@
@{Html.RenderAction("Search", "CvDen");}
@Html.Partial("Timkiem", "CvDen")

@using (Html.BeginForm())
{
    <div class="Control">
        <ul>
            <li>@Html.ActionLink("Thêm mới", "Create", "", new { @class = "vadd" })</li>
            <li>@Html.ActionLink("Làm mới", "Index", "", new { @class = "vrefresh" })</li>
            <li><a class="vback" href="javascript:void(0);" onclick="window.history.go(-1);">Trở lại</a></li>
        </ul>
    </div>
    @Html.Raw(ViewBag.Pager)
    <table class="TableView" border="1" id="myTable">
        <tr class="trHeader">
            <th class="CheckBoxsmall">
                <input type="checkbox" onclick="Javascript: chkSelectAll_OnClick(this)" id="chkSelectAll" />
            </th>
            <th class="Text">SỐ HIỆU CV</th>
            <th class="Date">NGÀY CVĐẾN </th>
            @*<th class="Date">NGÀY VÀO SỔ </th>*@
            <th class="Text">LĨNH VỰC</th>
            <th class="Text">LOẠI CÔNG VĂN</th>
            <th class="Text">TRÍCH YẾU</th>
            <th class="Text">NHÂN VIÊN</th>
            <th class="Text">CƠ QUAN</th>
            <th class="Text">NGƯỜI VIẾT</th>
            <th class="Text">GHI CHÚ</th>


            <th></th>
        </tr>

        @for (int i = 0; i < Model.Count; i++)
        {
            if (i % 2 == 0)
            {
                <tr style="max-height: 40px" id="trOdd_@i" class="trOdd" onmousemove="Javascript:chkSelect_OnMouseMove(this)" onmouseout="Javascript:chkSelect_OnMouseOut(this,0)">
                    <td class="CheckBoxsmall">@Html.CheckBox("chk" + Model[i].STTCV, new { id = "chkSelect", onclick = "Javascript:chkSelect_OnClick(this,0)", @class = "chk" })</td>
                    <td class="Text">@Html.DisplayFor(modelItem => Model[i].SOCV) &nbsp;@Html.ActionLink("Xem", "Details", new { id = Model[i].STTCV }, new { @class = "views", title = "Xem chi tiết" })</td>
                    <td class="Date">@Html.DisplayFor(modelItem => Model[i].NGAYCVDEN)</td>
                    @*<td class="Date">@Html.DisplayFor(modelItem => Model[i].NGAYVAOSO)</td>*@
                    <td class="Text">@Html.DisplayFor(modelItem => Model[i].LINHVUC.TENLV)</td>
                    <td class="Text">@Html.DisplayFor(modelItem => Model[i].LOAICV.TENLOAI)</td>
                    @*<td class="trichyeu">@{@Eoffice.Models.FormatText.FormatContentNews(@Model[i].TRICHYEUCVDEN, 70)}@Html.ActionLink("Sửa", "Edit", new { id = Model[i].STTCV }, new { @class = "vedit" })</td>*@
                    
                    <td class="trichyeu">@Html.ActionLink("Sửa", "Edit", new { id = Model[i].STTCV }, new { @class = "vedit" }) &nbsp;@Html.Raw(Model[i].TRICHYEUCVDEN) </td>
                    
                    <td class="Text">@Html.DisplayFor(modelItem => Model[i].NV.HOTENNV)</td>
                    <td class="Text">@Html.DisplayFor(modelItem => Model[i].CQNGOAI.TENCQ)</td>
                    <td class="Text">@Html.DisplayFor(modelItem => Model[i].NGUOIKY)</td>
                    <td class="Text">@Html.DisplayFor(modelItem => Model[i].GHICHU)</td>

                    <td class="Function">
                        @Html.ActionLink("Xóa", "Delete", new { id = Model[i].STTCV }, new { @onclick = "return DeleteConfirm()", @class = "vdelete", title = "Xóa" })
                    </td>
                </tr>
            }
            else
            {
                <tr id="trEven_@i" class="trEven" onmousemove="Javascript:chkSelect_OnMouseMove(this)" onmouseout="Javascript:chkSelect_OnMouseOut(this,@i)">
                    <td class="CheckBoxsmall">@Html.CheckBox("chk" + Model[i].STTCV, new { id = "chkSelect", onclick = "Javascript:chkSelect_OnClick(this,0)", @class = "chk" })</td>
                    <td class="Text">@Html.DisplayFor(modelItem => Model[i].SOCV) &nbsp;@Html.ActionLink("Xem", "Details", new { id = Model[i].STTCV }, new { @class = "views", title = "Xem chi tiết" })</td>
                    <td class="Date">@Html.DisplayFor(modelItem => Model[i].NGAYCVDEN)</td>
                    @*<td class="Date">@Html.DisplayFor(modelItem => Model[i].NGAYVAOSO)</td>*@
                    <td class="Text">@Html.DisplayFor(modelItem => Model[i].LINHVUC.TENLV)</td>
                    <td class="Text">@Html.DisplayFor(modelItem => Model[i].LOAICV.TENLOAI)</td>
                    @*<td class="trichyeu">@{@Eoffice.Models.FormatText.FormatContentNews(@Model[i].TRICHYEUCVDEN,70)}@Html.ActionLink("Sửa", "Edit", new { id = Model[i].STTCV }, new { @class = "vedit" })</td>*@
                    
                    <td class="trichyeu">@Html.ActionLink("Sửa", "Edit", new { id = Model[i].STTCV }, new { @class = "vedit" }) &nbsp;@Html.Raw(Model[i].TRICHYEUCVDEN) </td>
                    
                    <td class="Text">@Html.DisplayFor(modelItem => Model[i].NV.HOTENNV)</td>
                    <td class="Text">@Html.DisplayFor(modelItem => Model[i].CQNGOAI.TENCQ)</td>
                    <td class="Text">@Html.DisplayFor(modelItem => Model[i].NGUOIKY)</td>
                    <td class="Text">@Html.DisplayFor(modelItem => Model[i].GHICHU)</td>

                    <td class="Function">
                        @Html.ActionLink("Xóa", "Delete", new { id = Model[i].STTCV }, new { @onclick = "return DeleteConfirm()", @class = "vdelete", title = "Xóa" })
                    </td>
                </tr>
            }
        }

    </table>
    @Html.Raw(ViewBag.Pager)
    <div class="Control">
        <ul>
            <li>@Html.ActionLink("Thêm mới", "Create", "", new { @class = "vadd" })</li>
            <li>@Html.ActionLink("Làm mới", "Index", "", new { @class = "vrefresh" })</li>
            <li><a class="vback" href="javascript:void(0);" onclick="window.history.go(-1);">Trở lại</a></li>
        </ul>
    </div>
}

<script type="text/javascript">
    $(".trichyeu").shorten({
        "showChars": 110,
        "moreText": "Xem thêm",
        "lessText": "Rút gọn",
    });
</script>